package com.javandad.app.shared.entity;

import java.util.Date;

import javax.jdo.annotations.IdGeneratorStrategy;
import javax.jdo.annotations.IdentityType;
import javax.jdo.annotations.PersistenceCapable;
import javax.jdo.annotations.Persistent;
import javax.jdo.annotations.PrimaryKey;

@PersistenceCapable(identityType = IdentityType.APPLICATION, detachable = "false")
public class Friendship extends Notification {
	private static final long serialVersionUID = 8002502429493239520L;

	@SuppressWarnings("unused")
	private Friendship() {
	}

	public Friendship(String inviter, String confirmer, Date dateOfInvitation, Date dateOfConfirmation) {
		this.inviter = inviter;
		this.confirmer = confirmer;
		this.dateOfInvitation = dateOfInvitation;
		this.dateOfConfirmation = dateOfConfirmation;

	}

	public String getInviter() {
		return inviter;
	}
	
	public String getConfirmer() {
		return confirmer;
	}

	public Date getDateOfInvitation() {
		return dateOfInvitation;
	}

	public void setDateOfInvitation(Date dateOfInvitation) {
		this.dateOfInvitation = dateOfInvitation;
	}
	
	public Date getDateOfConfirmation() {
		return dateOfConfirmation;
	}
	public boolean isConfirmed() {
		return dateOfConfirmation != null;
	}
	public void setDateOfConfirmation(Date dateOfConfirmation) {
		this.dateOfConfirmation = dateOfConfirmation;
	}		
	
	public long getId() {
		return id;
	}
	
	@PrimaryKey
	@Persistent(valueStrategy = IdGeneratorStrategy.IDENTITY)
	private Long id;
	
	@Persistent
	private String inviter;
	@Persistent
	private String confirmer;
	@Persistent
	private Date dateOfInvitation;
	@Persistent
	private Date dateOfConfirmation;
	

}
